package one.stand.feign;

import one.stand.entity.websocket.CommodityInfoEntity;
import one.stand.entity.websocket.CompanyInfoEntity;
import one.stand.fallback.CrmFallBack;
import one.stand.model.ResultModel;
import one.stand.request.BusinessCardRequest;
import one.stand.request.ConsultRecordRequest;
import one.stand.response.BusinessCardResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * @author Administrator
 */
@Component
@FeignClient(value = "crm-service", fallback = CrmFallBack.class, decode404 = true)
public interface CrmFegin {

    /**
     * 消息服务获取公司信息
     * @param cardId
     * @return
     */
    @PostMapping("businessCard/messageGetCompanyInfo")
    ResultModel<CompanyInfoEntity> messageGetCompanyInfo(@RequestParam(value="cardId") Long cardId);

    /**
     * 产品咨询
     * @param specId
     * @return
     */
    @PostMapping("goods/getSendMessage")
    ResultModel<CommodityInfoEntity> getSendMessage(Long specId);


    @PostMapping("businessCard/getCardPhone")
    ResultModel<BusinessCardResponse> getCardPhone(@RequestBody BusinessCardRequest request);

    /**
     * 发送给user端的客戶
     *
     * @param sendUserId 发送人userId
     * @param receiveUserId 接收人userId
     * @param text 聊天消息提示內容
     * @param type 0未读消息提示，1联系方式提示
     * @return
     */
    @PostMapping("businessCard/unreadMessage")
    ResultModel unreadMessage(@RequestParam(value="sendUserId") Integer sendUserId, @RequestParam(value="receiveUserId") Integer receiveUserId, @RequestParam(value="text") String text, @RequestParam(value="type") Integer type);
}
